package com.my.demo.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//偶尔进行测试的接口
public class Test {
  @RequestMapping("/test")
  public Object test(HttpSession session, HttpServletRequest req) {
    Object id = session.getAttribute("id");
    if(id==null){
      session.setAttribute("id", 36);
      return "已设置session=36";
    }
    return  id;
  }
}
